home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWCommon / Include / FWErrors.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  8.5 KB  |  202 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWErrors.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWERRORS_H
  11. #define FWERRORS_H
  12.  
  13. #if defined(FW_BUILD_MAC) && !defined(__ERRORS__)
  14. #include <Errors.h>
  15. #endif
  16.  
  17. #ifndef SOM_Module_OpenDoc_Errors_defined
  18. #include <ErrorDef.xh>
  19. #endif
  20.  
  21. //========================================================================================
  22. //  Type definitions
  23. //========================================================================================
  24.  
  25. typedef     long            FW_PlatformError;
  26.  
  27. //========================================================================================
  28. //  Platform Error constants, to be moved to FWErrors.h
  29. //========================================================================================
  30.  
  31. // Note that ODF always uses symbolic constants for error codes, but the physical values 
  32. // of the error codes may vary across platforms. Wherever possible, ODF attempts to use
  33. // standard error codes already defined for the platform.  ODF defines new error codes
  34. // only when no previously existing error platform error code is appropriate.
  35.  
  36. // On the Macintosh, the ODF project has 
  37. // been allocated the OSErr error code range of -30200 to -30259 (inclusive).  In ODF1
  38. // Most symbolic error constants are defined to be based upon their Macintosh values.
  39. // In future releases, we may use conditional code to assign platform specific values
  40. // to more of the error codes.  ODF developers should not rely on the specific values of 
  41. // of any error codes 
  42.  
  43. const FW_PlatformError FW_xFirstODFError            = -30200;
  44. const FW_PlatformError FW_xLastODFError                = -30259;
  45.  
  46. const FW_PlatformError FW_xLastUsedODFError            = -30214; //FW_xInvalidPictureData
  47.  
  48. // ===== FWCommon Errors =====
  49.  
  50. const FW_PlatformError FW_xNoError = 0;
  51.     // Not an error, i.e. success.
  52.     
  53. const FW_PlatformError FW_xUnknownError = -30200;
  54.     // An error occured within ODF that could not be attributed to a more specific
  55.     // cause.  ODF uses this error only when it has no other choice.
  56.     
  57. // ===== FWCollec Errrors
  58.  
  59. const FW_PlatformError FW_xBadInsert = -30201;
  60.     // Error occured inserting item into a sorted array.
  61.     // This error should only occur if the private interface to sorted array is misused.
  62.     // The error should not happen to clients of FW_TMap<key, value>.
  63.  
  64. // ===== FWMemory Errors
  65.  
  66. #if defined(FW_BUILD_MAC)
  67. const FW_PlatformError FW_xMemoryExhausted = memFullErr;
  68. #elif defined(FW_BUILD_WIN)
  69. const FW_PlatformError FW_xMemoryExhausted = -30999; //!!!JEL: Need correct value!!!
  70. #endif
  71.  
  72. // ===== FWStream Errors
  73.  
  74. const FW_PlatformError FW_xReadableStream = -30202;
  75.     // An error occured while reading from a stream.  Most probable cause is unexpected
  76.     // end of sink while attemping to read a value such as a nul terminated string.
  77.  
  78. const FW_PlatformError FW_xWritableStream = -30203;
  79.     // An error occured while writing to a stream.  Most probable cause is sink full.
  80.     
  81. const FW_PlatformError FW_xCorruptArchiveStream = -30204;
  82.     // An error occured while reading from a stream containing an archive of objects.
  83.     // One likely cause is that an archivable class has not defined it's create/initialize
  84.     // archiving functions to be consistent with it output archiving function.  If, say,
  85.     // the initialize function for a class reads too much or too little data, then the
  86.     // stream will not be left pointing at a meaningful location, and the next attempt
  87.     // by the archiver to read metadata will result in bad metadata.
  88.  
  89. // ===== FWString Errors
  90.  
  91. const FW_PlatformError FW_xStringResourceNotFound = -30205;
  92.     // No string with the given id was found in the resource
  93.  
  94. // ===== FWGraphx Errors
  95.  
  96. const FW_PlatformError FW_xPrintingCanceled     = -30206;
  97. const FW_PlatformError FW_xNoDefaultPrinter     = -30207;
  98. const FW_PlatformError FW_xGraphicException        = -30212;
  99. const FW_PlatformError FW_xInvalidBitmapData     = -30213;
  100. const FW_PlatformError FW_xInvalidPictureData     = -30214;
  101.  
  102. // ===== FWFiles Errors
  103.  
  104. const FW_PlatformError FW_xCantDeleteWorkingDirectory = -30208;
  105. const FW_PlatformError FW_xInvalidDirectory           = -30209;
  106.  
  107. #ifdef FW_BUILD_MAC
  108. const FW_PlatformError FW_xAFPAccessDenied = afpAccessDenied;
  109. const FW_PlatformError FW_xAFPDenyConflict = afpDenyConflict;
  110. const FW_PlatformError FW_xAFPObjectTypeErr = afpObjectTypeErr;
  111. const FW_PlatformError FW_xBadFileName = bdNamErr;
  112. const FW_PlatformError FW_xDirectoryBusy = fBsyErr;
  113. const FW_PlatformError FW_xDirectoryFull = dirFulErr;
  114. const FW_PlatformError FW_xDiskFull = dskFulErr;
  115. const FW_PlatformError FW_xEndOfFileReached = eofErr;
  116. const FW_PlatformError FW_xFileBusy = fBsyErr;
  117. const FW_PlatformError FW_xFileExists = dupFNErr;
  118. const FW_PlatformError FW_xFileLocked = fLckdErr;
  119. const FW_PlatformError FW_xNoFileFound = fnfErr; 
  120. const FW_PlatformError FW_xFileNotOpen = fnOpnErr;
  121. const FW_PlatformError FW_xGeneralIOError = ioErr;
  122. const FW_PlatformError FW_xGetFPosError = gfpErr;
  123. const FW_PlatformError FW_xInvalidAccess = wrPermErr;
  124. const FW_PlatformError FW_xInvalidFileReference = rfNumErr;
  125. const FW_PlatformError FW_xNoSuchVolume = nsvErr; 
  126. const FW_PlatformError FW_xNotAnHFSVolume = wrgVolTypErr;
  127. const FW_PlatformError FW_xParameterError = paramErr;
  128. const FW_PlatformError FW_xPathNotFound = dirNFErr; 
  129. const FW_PlatformError FW_xPermissionError = permErr;
  130. const FW_PlatformError FW_xRenameError = fsRnErr;
  131. const FW_PlatformError FW_xSeekError = posErr;
  132. const FW_PlatformError FW_xSharingViolation = opWrErr;
  133. const FW_PlatformError FW_xTooManyOpenFiles = tmfoErr;
  134. const FW_PlatformError FW_xVolumeLocked = vLckdErr;
  135. const FW_PlatformError FW_xWriteProtect = wPrErr;
  136. #endif
  137.  
  138. #ifdef FW_BUILD_WIN16
  139. const FW_PlatformError FW_xNoError = 0; 
  140. const FW_PlatformError FW_xBadFileName = 123;
  141. const FW_PlatformError FW_xDirectoryBusy = 16;
  142. const FW_PlatformError FW_xDirectoryFull = 82;
  143. const FW_PlatformError FW_xDiskFull = 39;
  144. const FW_PlatformError FW_xEndOfFileReached = 38;
  145. const FW_PlatformError FW_xFileExists = 80;
  146. const FW_PlatformError FW_xFileLocked = 33;
  147. const FW_PlatformError FW_xNoFileFound = 2; 
  148. const FW_PlatformError FW_xFileNotOpen = 1006; 
  149. const FW_PlatformError FW_xGeneralIOError = 31;
  150. const FW_PlatformError FW_xInvalidAccess = 12;
  151. const FW_PlatformError FW_xInvalidFileReference = 6;
  152. const FW_PlatformError FW_xNoSuchVolume = 15; 
  153. const FW_PlatformError FW_xParameterError = 87;
  154. const FW_PlatformError FW_xPathNotFound = 3; 
  155. const FW_PlatformError FW_xPermissionError = 5;
  156. const FW_PlatformError FW_xReadFault = 30;
  157. const FW_PlatformError FW_xSeekError = 25;
  158. const FW_PlatformError FW_xSharingViolation = 32;
  159. const FW_PlatformError FW_xTooManyOpenFiles = 4;
  160. const FW_PlatformError FW_xWriteFault = 29;
  161. const FW_PlatformError FW_xWriteProtect = 19;
  162. #endif
  163.  
  164. #ifdef FW_BUILD_WIN32
  165. const FW_PlatformError FW_xNoError = NO_ERROR; 
  166. const FW_PlatformError FW_xBadFileName = ERROR_INVALID_NAME;
  167. const FW_PlatformError FW_xDirectoryBusy = ERROR_CURRENT_DIRECTORY;
  168. const FW_PlatformError FW_xDirectoryFull = ERROR_CANNOT_MAKE;
  169. const FW_PlatformError FW_xDiskFull = ERROR_HANDLE_DISK_FULL;
  170. const FW_PlatformError FW_xEndOfFileReached = ERROR_HANDLE_EOF;
  171. const FW_PlatformError FW_xFileExists = ERROR_FILE_EXISTS;
  172. const FW_PlatformError FW_xFileLocked = ERROR_LOCK_VIOLATION;
  173. const FW_PlatformError FW_xNoFileFound = ERROR_FILE_NOT_FOUND; 
  174. const FW_PlatformError FW_xFileNotOpen = ERROR_FILE_INVALID; 
  175. const FW_PlatformError FW_xGeneralIOError = ERROR_GEN_FAILURE;
  176. const FW_PlatformError FW_xInvalidAccess = ERROR_INVALID_ACCESS;
  177. const FW_PlatformError FW_xInvalidFileReference = ERROR_INVALID_HANDLE;
  178. const FW_PlatformError FW_xNoSuchVolume = ERROR_INVALID_DRIVE; 
  179. const FW_PlatformError FW_xParameterError = ERROR_INVALID_PARAMETER;
  180. const FW_PlatformError FW_xPathNotFound = ERROR_PATH_NOT_FOUND; 
  181. const FW_PlatformError FW_xPermissionError = ERROR_ACCESS_DENIED;
  182. const FW_PlatformError FW_xReadFault = ERROR_READ_FAULT;
  183. const FW_PlatformError FW_xSeekError = ERROR_SEEK;
  184. const FW_PlatformError FW_xSharingViolation = ERROR_SHARING_VIOLATION;
  185. const FW_PlatformError FW_xTooManyOpenFiles = ERROR_TOO_MANY_OPEN_FILES;
  186. const FW_PlatformError FW_xWriteFault = ERROR_WRITE_FAULT;
  187. const FW_PlatformError FW_xWriteProtect = ERROR_WRITE_PROTECT;
  188. #endif
  189.     
  190. // ===== FWResour Errors
  191.  
  192. const FW_PlatformError FW_xResourceFileNotFound            = -30210;
  193. const FW_PlatformError FW_xResourceNotLoaded            = -30211;
  194.  
  195. #ifdef FW_BUILD_MAC
  196. const FW_PlatformError FW_xResourceNotFound                = resNotFound;
  197. #else
  198. const FW_PlatformError FW_xResourceNotFound                = FW_xResourceNotLoaded;// !!! Need a better assignment
  199. #endif
  200.  
  201. #endif
  202.